﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InsertSessionTime.aspx.cs" Inherits="TheatreStaff_InsertSessionTime" %>
<%@ Register TagPrefix="custom" Namespace="myControls" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Web.Configuration" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<script type="text/javascript">

    function displayCalendar() {
        var datePicker = document.getElementById('datePicker');
        datePicker.style.display = 'block';
    }
</script>
<script runat ="server" >
    void Page_Load()
    {
        if (!Page.IsPostBack)
            //grdSession.SelectedIndex = 0;
        Label15.Text = string.Empty;
        Label16.Text = string.Empty;
    }
    protected void Cancel(object sender, EventArgs e)
    {
        
        txtSessionTimeI.Text = string.Empty;
        ddlCinemaI.SelectedIndex = -1;
        //txtDurationI.Text = string.Empty;
        Label15.Text = string.Empty;
        Label16.Text = string.Empty;
        //grdSession.DataBind();
    }
    protected void Clear(object sender, EventArgs e)
    {
        Label15.Text = string.Empty;
        Label16.Text = string.Empty; 
    }
    protected void OnItemUpdated_Click(object sender, DetailsViewUpdatedEventArgs e)
    {
        //grdSession.DataBind();
        Label15.Text = string.Empty;
        Label16.Text = string.Empty;
    }
    protected void InsertS_Click(object sender, EventArgs e)
    {
        Label15.Text = string.Empty;
        Label16.Text = string.Empty; 
        string connectionString;
        connectionString = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection con = new SqlConnection(connectionString);
        SqlConnection con1 = new SqlConnection(connectionString);
        SqlCommand cmd1 = new SqlCommand("INSERT session2(time,cinema) values (@time,@cinema)", con1);
        SqlCommand cmd = new SqlCommand("SELECT time,cinema from session2,TheatreStaff,Cinema WHERE TheatreStaff.TheatreId=Cinema.TheatreId AND Cinema.CinemaId=session2.cinema AND Cinema.TheatreId=@TheatreId AND session2.time=@time AND session2.cinema=@cinema", con);
        string ParamString = lblId.Text;
        Int32 RowCount;
        Boolean HasS;

        cmd.Parameters.AddWithValue("@TheatreId", ParamString);
        cmd.Parameters.AddWithValue("@time", txtSessionTimeI.Text );
        cmd.Parameters.AddWithValue("@cinema", ddlCinemaI.SelectedValue);

        using (con)
        {
            con.Open();
            SqlDataReader Reader = cmd.ExecuteReader();

            if (Reader.HasRows)
            {
                
                Label15.Text = "The session time" + " already exist in the database!";
                //lblCheck.Text = string.Empty;
                //ClientScript.RegisterClientScriptBlock(ClientScript.GetType(), "Focus", "<script language='JavaScript' 'showInsert();'/>");

                HasS = true;

            }
            else
            {
                HasS = false;

            }
        }
        using (con1)
        {
            con1.Open();
            if (HasS == false)
            {
                
                cmd1.Parameters.AddWithValue("@time", txtSessionTimeI.Text);
                cmd1.Parameters.AddWithValue("@cinema", ddlCinemaI.SelectedValue );
                //cmd1.Parameters.AddWithValue("@Duration", txtDurationI.Text);
                RowCount = cmd1.ExecuteNonQuery();
               
                //txtDurationI.Text = string.Empty;
                //if (RowCount > 0)
                //{
                Label16.Text = "The session time " + txtSessionTimeI.Text.ToString() + " has been added sucessfully " + "to cinema " + ddlCinemaI.SelectedValue.ToString();
                //lblCorrect.Visible = true;
                txtSessionTimeI.Text = string.Empty;
                ddlCinemaI.SelectedIndex = -1;

                //}
            }

        }
        //grdSession.DataBind();
    }
    
</script>
<%--This below code from the website:http://ramanisandeep.wordpress.com/2008/11/07/hide-an-aspnet-label-control-after-a-few-seconds/--%>

<script type="text/javascript">
    self.setInterval("changeValue1()", 4000);

    function changeValue1() {
        document.getElementById("Label15").innerText = "";

    }
    self.setInterval("changeValue()", 4000);
    function changeValue() {
        document.getElementById("Label16").innerText = "";

    }
</script>
 <style type="text/css">
        #datePicker
        {
            display:none;
            position:absolute;
            border:solid 2px black;
            background-color:white;
           
        }
    
    </style>
<style type="text/css">
#divDisplay
{
    border:solid 1px White;
    width:400px;
    padding:15px;
    margin:0px auto;
    text-align:center;
    border:1px solid #333;
}
.center1
{
    padding-left:320px;
}
#divInsert
{
    display:none;
    border:solid 1px black;
    width:500px;
    position:absolute;
    top:200px;
    left:100px;
    padding:10px;
    background-color:Silver;
    color:Black ;
}
.C
{
         color:#FFFFCC;
    font-size:larger;
    font-weight :bolder ;
}
.I
{
    color:red ;
    font-size:larger;
    font-weight :bolder ;
}
html
{
  background-image:url('image/back.jpg'); 

    padding:10px;
    color:White;    
  
}
.content1
{
    padding-left:50px;
    margin:auto;
    width:850px;
}
.column
{
    float:left;
    width:348px;
}
.selectedRow
{
    background-color:Silver;
}

.content
{
   
    width:950px;
    margin:auto;
        height: 197px;
}

.link
{
  margin-left:350px; 
     font-weight:bold;
  font-size:large;  
    font-size:x-large;
}
.link2
{
  margin-left:50px; 
     font-weight:bold;
  font-size:large;  
    font-size:x-large;
}
a
{
 color: white;
 text-decoration:underline;
 font-weight:bold;

}
a:hover
{
 color: red; 
  text-decoration:none;
  font-weight:bold;

}
.join
{
   background-color:#0099FF;
  clip:auto;
  font-weight:bold;
  font-size:large;
}
.table2
{
 border-style:solid;
   border-color:Black;
   background-color:White;
   color:Black;  
   width:900px; 
}
.row
{
   background-color:Gray;
   color:White;
}
.ticket
{
   background-color:#CC0000;
color:White;

}

.ticket:hover
{
 color: black; 
  text-decoration:none;


}
    .style1
    {
        width: 509px;
    }
    
.footer
{

     font-weight:bold;
  font-size:large;  

}
.ticket1
{
    padding-left:200px;
}
.view2
{
 padding-left:380px;  
}
.text
{
 font-weight:bold;
}
.button
{
 margin-left:250px;
}
.view3
{
    padding-left:120px;
}
.footer
{

   margin-top:250px;
}
.center
{
    padding-left:410px;
}
.legend
{
  
    color:White;  
} 
.cinema
{
    padding-left:590px;
} 
           .menu
{
 padding-left:580px;  

}
</style>
    <title>Session Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div class="content">
  <asp:Image ID="Image1" Width="1000" Height="130" ImageUrl="~/image/tdk-jun5-bannerbatmanexclusivo2.jpg" runat="server" />
<asp:HyperLink ID="HyperLink14"  CssClass="link" NavigateUrl="~/Default.aspx" runat="server">Home</asp:HyperLink>
<asp:HyperLink ID="HyperLink1"  CssClass="link2" NavigateUrl="~/Session.aspx" runat="server">Session</asp:HyperLink> <asp:HyperLink ID="HyperLink2" CssClass="link2" NavigateUrl="~/Movie.aspx" runat="server">Movies</asp:HyperLink>
<asp:HyperLink ID="HyperLink3" CssClass="link2"  NavigateUrl="~/Price.aspx" runat="server">Prices</asp:HyperLink>

<br /> <br />
<table class="center1" >
        <tr>
            <td>
               <asp:Label ID="Label22222"  CssClass="menu" runat="server"  Text="Theatre" Font-Bold="True" Font-Underline="True"></asp:Label>  
            </td>
            <td>
                 <asp:Label ID="Label5" runat="server"  ForeColor="Yellow"></asp:Label>
                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
       <%-- </tr>
 </table> --%>
    <%--<td>&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp &nbsp&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp &nbsp&nbsp;&nbsp</td>--%>
<%--&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp &nbsp&nbsp;&nbsp --%>
  <%--<table align="center" >
        <tr>--%>
            <td>
                <asp:Label ID="Label12" runat="server" Text="UserName" Font-Bold="True"></asp:Label>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td>
                <asp:LoginName ID="LoginName1" runat="server" /> 
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td>
                 <asp:LoginStatus ID="LoginStatus1" runat="server" ForeColor="#99CCFF" />
                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
        </tr>
    </table>
  <%-- <asp:Label ID="Label05" runat="server"  Text="Theatre" CssClass="cinema" Font-Bold="True" Font-Underline="True"></asp:Label>
        <asp:Label ID="Label5" runat="server"  ForeColor="Yellow"></asp:Label>
      
&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp &nbsp&nbsp;&nbsp 
          <asp:Label ID="Label6" runat="server" Text="UserName" Font-Bold="True"></asp:Label>    <asp:LoginName ID="LoginName1" runat="server" /> 
    &nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp<asp:LoginStatus ID="LoginStatus1" runat="server" ForeColor="#99CCFF" />--%>
        <hr />
  <asp:Label ID="Label8" runat="server" Text="Maintain:" Font-Bold="True" Font-Size="Larger" Font-Underline="True"></asp:Label>
<asp:HyperLink ID="HyperLink4" runat="server" 
            NavigateUrl="~/TheatreStaff/Cinema.aspx" ForeColor="#FFCC99">[Cinemas]</asp:HyperLink>&nbsp;&nbsp;
    <asp:HyperLink ID="HyperLink5" runat="server"  ForeColor="#FFFF99" NavigateUrl="~/TheatreStaff/Movies.aspx">[Movies]</asp:HyperLink> &nbsp;
    <asp:HyperLink ID="HyperLink144" runat="server" NavigateUrl="~/TheatreStaff/Schedule.aspx" ForeColor="#FF9900">[Schedules]</asp:HyperLink>&nbsp;   
 <asp:HyperLink ID="HyperLink117" runat="server" NavigateUrl="~/TheatreStaff/Session.aspx" ForeColor="#FF6699">[Session Times]</asp:HyperLink>&nbsp;  
  <asp:HyperLink ID="HyperLink116" runat="server" NavigateUrl="~/TheatreStaff/SessionDates.aspx" ForeColor="#66FF66">[Session Date]</asp:HyperLink>&nbsp;    
 <asp:HyperLink ID="HyperLink115" runat="server" NavigateUrl="~/TheatreStaff/SpecialTickets.aspx" ForeColor="Aqua">[Specail Price]</asp:HyperLink>&nbsp;
 <asp:HyperLink ID="HyperLink107" runat="server" NavigateUrl="~/TheatreStaff/specialday.aspx" ForeColor="#CCFF33">[Special Ticket Pricing Days]</asp:HyperLink>&nbsp; 
    <asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="~/TheatreStaff/SalesReports.aspx" ForeColor="#CCFFFF">[Sales Report]</asp:HyperLink>&nbsp; 
            <asp:HyperLink ID="HyperLink11" runat="server" NavigateUrl="~/TheatreStaff/AddNewUser.aspx" ForeColor="#66FF99">[Add New User]</asp:HyperLink>&nbsp; 
  <hr />
<h3><asp:Label ID="Label2" Text ="Insert Sesssion Times" runat="server" CssClass="center" ForeColor="#FF6699" /></h3>        
  <asp:BulletedList ID="BulletedList1" CssClass ="center1" ForeColor="#FF6699" runat="server">
            <%--<asp:ListItem> When you insert the release date, please insert folowing the format: mm/dd/yyyy</asp:ListItem>--%>
            <asp:ListItem Text ="Click 'Cancel' to return to the Session Time Maintenance section" />
            </asp:BulletedList>
 
        <asp:ScriptManager ID="ScriptManager2" runat="server" />
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
        <div class ="content1">
        <asp:Label ID="lblId" runat="server" Visible="false" ></asp:Label>
         <table  >
            <tr>
                <td> <h3><asp:Label ID="Label1" Text ="Maintain Movie Sesssions Times" Visible="false" runat="server" /></h3></td>
            </tr>
         </table>
            
           <%-- <div class="column">--%>
            <asp:Label ID="Label15" CssClass="I" runat="server"  Text="" ></asp:Label> 
                    <%--<asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="CustomValidator"></asp:CustomValidator>--%>
                    <%--<asp:RequiredFieldValidator ID="reqError" runat="server" ControlToValidate="lblError" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>--%>
                    
             <asp:Label ID="Label16" CssClass="C" runat="server" Text=""></asp:Label>
            <%--<asp:GridView ID="grdSession"
            AllowPaging="true" DataSourceID ="srcgrdSession"
            AutoGenerateSelectButton ="true"
            DataKeyNames ="sessionid" AutoGenerateColumns ="false" runat="server" 
                 Height="360px" Width="16px" OnSelectedIndexChanged ="Clear">
                <Columns >
                    <custom:DeleteButtonField CommandName="Delete" ConfirmText ="Are you sure that you want to delete this record?" />--%>
                    <%--<asp:BoundField DataField="sessionid" HeaderText ="Session Id" />--%>
                    <%--<asp:BoundField DataField ="sessionid" HeaderText ="Session Id" />--%>
                    <%--<asp:BoundField DataField ="cinema" HeaderText ="Cinema Id" />
                    <asp:BoundField DataField ="time" HeaderText ="Session Time" DataFormatString ="{0:t}" />
                </Columns>
            </asp:GridView>
            <a href="JavaScript:showInsert();">Insert Session Time</a>
           </div>
         <div class="column">
               <asp:DetailsView ID="dtlSpecial" 
               AutoGenerateEditButton ="true"  OnItemUpdated ="OnItemUpdated_Click"   
               AutoGenerateRows ="false" runat="server" DataKeyNames ="sessionid" DataSourceID ="srcSessionSelect">
                <Fields >
                  
                    <asp:TemplateField HeaderText ="Session Time" HeaderStyle-Font-Bold="true">
                        <ItemTemplate>
                            <%# Eval("time","{0:t}")%> 
                        </ItemTemplate>
                         <EditItemTemplate>
                                  <asp:TextBox
                                    id="txtSessionTime"
                                    Text='<%# Bind("time") %>'
                                    Runat="server"/>
                                  <asp:RequiredFieldValidator
                                    id="reqTime"
                                    ControlToValidate="txtSessionTime"
                                    Text="(Required)"
                                    Runat="server" />
                                <asp:RegularExpressionValidator ID="regTime"
                                    runat="server" ErrorMessage="(Please enter the time in the 
                                    following format - 00:00:00)"
                                    ControlToValidate ="txtSessionTime" ValidationExpression="(^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$|^([01]\d|2[0-3])(:[0-5]\d){0,2}$)"></asp:RegularExpressionValidator>
                            </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText ="Cinema" HeaderStyle-Font-Bold="true">
                        <ItemTemplate>
                            <%# Eval("cinema")%> 
                        </ItemTemplate>
                         <EditItemTemplate >
                         <asp:DropDownList 
                                    ID="ddlCinema" 
                                     DataSourceID ="srcCinema" 
                                     DataTextField ="CinemaId"
                                     DataValueField ="CinemaId"  
                                     SelectedValue='<%# Bind("cinema") %>'
                                     runat="server" AppendDataBoundItems ="true" >
                                     <asp:ListItem Text ="Select" Value ="-1" />
                                    </asp:DropDownList> 
                         
                                <asp:RequiredFieldValidator
                                    id="reqMovie"
                                    ControlToValidate="ddlCinema"
                                    InitialValue ="-1" 
                                    Text="(Required)"
                                    Runat="server" />
                        </EditItemTemplate>
                    </asp:TemplateField>--%>
                   <%-- <asp:TemplateField HeaderText ="Duration" HeaderStyle-Font-Bold="true" >
                        <ItemTemplate >
                             <%# Eval("Duration")%>
                        </ItemTemplate>
                        <EditItemTemplate >
                             <asp:TextBox
                            id="txtDuration"
                            Text='<%# Bind("Duration") %>'
                            Runat="server"/>
                          <asp:RequiredFieldValidator
                            id="reqDuration"
                            ControlToValidate="txtDuration"
                            Text="(Required)"
                            Runat="server" />
                            <asp:CompareValidator ID="CompareValidator1" ControlToValidate="txtDuration" 
                            runat="server" ErrorMessage="(Please enter a numeric value for duration)" Type="Integer" Operator="DataTypeCheck"></asp:CompareValidator> 
                        </EditItemTemplate>
                    </asp:TemplateField>--%>
                 <%-- </Fields>
               </asp:DetailsView>
           </div>      
    </div>--%>
     <%--<div id="divInsert">--%>
        <fieldset >
            <legend   class ="legend">Insert Session Times</legend>
            <table align="center" >
               
                <tr>
                    <td>
                        <asp:Label ID="Label3" runat="server" Text="Session Time"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtSessionTimeI" runat="server"></asp:TextBox>
                    </td>
                    <td>    
                        <asp:RequiredFieldValidator ID="reqSessionTimeI" runat="server" ControlToValidate="txtSessionTimeI" ErrorMessage="(Required)"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="regTime"
                                    runat="server" ErrorMessage="(Please enter the time in the 
                                    following format - hh:mm)"
                                    ControlToValidate ="txtSessionTimeI" ValidationExpression="([0-1]\d|2[0-3]):([0-5]\d)"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label4" runat="server" Text="Cinema"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList 
                        ID="ddlCinemaI" 
                         DataSourceID ="srcCinema" 
                         DataTextField ="CinemaId"
                         DataValueField ="CinemaId"
                         runat="server" AppendDataBoundItems ="true" >
                         <asp:ListItem Text ="Select" Value ="-1" />
                        </asp:DropDownList>   
                    </td>
                    <td>
                       <asp:RequiredFieldValidator
                        id="reqMovieI"
                        ControlToValidate="ddlCinemaI"
                        InitialValue ="-1" 
                        Text="(Required)"
                        Runat="server" /> 
                    </td>
                </tr>
               <%-- <tr>
                    <td>
                        <asp:Label ID="lblD" runat="server" Text="Duration"></asp:Label>
                    </td>
                    <td>
                         <asp:TextBox
                            id="txtDurationI"
                            Runat="server"/>
                    </td>
                    <td>
                          <asp:RequiredFieldValidator
                            id="reqDuration"
                            ControlToValidate="txtDurationI"
                            Text="(Required)"
                            Runat="server" />
                            <asp:CompareValidator ID="CompareValidator1" ControlToValidate="txtDurationI" 
                            runat="server" ErrorMessage="(Please enter a numeric value for duration)" Type="Integer" Operator="DataTypeCheck"></asp:CompareValidator> 
                    </td>
                </tr>--%>
          
                <tr>
                <td>
                    <%--<asp:Button ID="Button1"   runat="server" Text="Button" />--%>
                    <asp:LinkButton ID="btnInsert"  OnClick ="InsertS_Click" runat="server">Insert</asp:LinkButton>
                </td>
                <td>
                    <asp:LinkButton ID="btnCancel" PostBackUrl ="~/TheatreStaff/Session.aspx" OnClick ="Cancel" CommandName="Cancel" CausesValidation ="false"  runat="server">Cancel</asp:LinkButton>
                </td>
                </tr>
            </table>
        </fieldset> 
 <%--     </div> --%>
      </ContentTemplate>
            </asp:UpdatePanel>
       <asp:SqlDataSource ID="srcgrdSession" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            SelectCommand="SELECT session2.sessionid,
            session2.time,session2.cinema,session2.Duration FROM session2,Cinema,TheatreStaff WHERE 
            session2.cinema=Cinema.CinemaId AND
            TheatreStaff.TheatreId=Cinema.TheatreId AND TheatreStaff.TheatreStaffUserName = @username"
            DeleteCommand ="DELETE session2 WHERE sessionid=@sessionid" >
            
                 <SelectParameters>
                  <asp:Parameter Name ="username" Type ="string"/> 
                 </SelectParameters>
            
            </asp:SqlDataSource>
         
            <%--<asp:SqlDataSource ID="srcSessionSelect" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT session2.sessionid,
            session2.time,session2.cinema,session2.Duration FROM session2 WHERE sessionid=@sessionid"
            UpdateCommand ="UPDATE session2 SET time=@time,
            cinema=@cinema, Duration=@Duration
            WHERE sessionid=@sessionid"
            runat="server">--%>
                <%--<SelectParameters>
                  <asp:ControlParameter Name ="sessionid" ControlID ="grdSession" />
                </SelectParameters>--%>
              <%--  <UpdateParameters >
                    <asp:Parameter Name="sessionid" DbType ="Int32" />--%>
                    <%--<asp:Parameter Name="time" DbType ="Time"    />--%>
                <%--</UpdateParameters>
            </asp:SqlDataSource>--%>
      <%-- <asp:SqlDataSource ID="srcSessionSelect"
                runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                SelectCommand="SELECT  Schedule.ScheduleStartDate,datesession.ses皜ionid,session2.time, session2.cinema, 
                datesession.date, datesession.ticketsold,datesession.scheduleid, 
                datesession.sessiontype, Movie.MovieTitle,datesession.movieid FROM session2 
                INNER JOIN datesession ON 
                session2.sessionid = datesession.sessionid INNER JOIN Movie ON 
                datesession.movieid = Movie.MovieId INNER JOIN Cinema ON 
                session2.cinema = Cinema.cinema INNER JOIN TheatreStaff ON 
                Cinema.TheatreId = TheatreStaff.TheatreId INNER JOIN Schedule ON TheatreStaff.TheatreId=Schedule.TheatreId WHERE
                (datesession.sessionid=@sessionid)"
                UpdateCommand ="UPDATE datesession SET date=@date,
                movieid=@movieid,sessiontype=@sessiontype, scheduleid=@scheduleid
                WHERE sessionid=@sessionid AND date=@date"
                InsertCommand="INSERT INTO datesession(date,movieid,sessiontype,scheduleid)
                VALUES (@date,@movieid,@sessiontype,@scheduleid)"
               >
                
                 <SelectParameters>
                  <%--<asp:Parameter Name ="username" Type ="string"/> 
                <%--  <asp:ControlParameter Name ="sessionid" ControlID ="grdSession" />
                </SelectParameters>
                <UpdateParameters >--%>
                    <%--<asp:ControlParameter Name="sessiontype"  ControlID ="ddlType" 
                    PropertyName ="SelectedValue"/>--%>
                   <%-- <asp:Parameter Name="sessionid" DbType ="Int32" />
                    <asp:Parameter Name="date" DbType ="Date"  />
                </UpdateParameters>
        
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="srcType" runat="server" 
                  ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                  SelectCommand="SELECT DISTINCT sessiontype FROM datesession">
            </asp:SqlDataSource>--%>
            <asp:SqlDataSource ID="srcCinema" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            SelectCommand="SELECT DISTINCT CinemaId FROM Cinema WHERE TheatreId=@TheatreId">
                <SelectParameters >
                    <asp:ControlParameter Name ="TheatreId" ControlID ="lblId"/>
                </SelectParameters>
            </asp:SqlDataSource>
           <%-- <asp:SqlDataSource ID="srcSchedule" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            SelectCommand="SELECT ScheduleId, ScheduleStartDate FROM Schedule WHERE TheatreId=@TheatreId">
                <SelectParameters >
                    <asp:ControlParameter Name ="TheatreId" ControlID ="lblId"/>
                </SelectParameters>
            </asp:SqlDataSource>--%>
        </div>
        <br /><br /><br /><br /><br />
  <table width="100" cellpadding="15" ><tr><td>Copyright@2012 MovieTix</td><td><asp:HyperLink ID="HyperLink8"  CssClass="footer" NavigateUrl="~/Default.aspx" runat="server">Homepage</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink9"  CssClass="footer" NavigateUrl="~/Session.aspx" runat="server">Session</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink10"  CssClass="footer" NavigateUrl="~/Movie.aspx" runat="server">Movies</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink12"  CssClass="footer" NavigateUrl="~/register.aspx" runat="server">Register</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink13"  CssClass="footer" NavigateUrl="~/Login.aspx" runat="server">Log In</asp:HyperLink></td></tr></table>
      </div>
    </form>
</body>
</html>